<?php


namespace BoojasrFramework\ServicesContainer\Event;



use BoojasrFramework\ServicesContainer\HttpKernelInterface;
use BoojasrFramework\ServicesContainer\Request;

class ControllerEvent extends KernelEvent
{
    private $controller;

    public function __construct(HttpKernelInterface $kernel, ?callable $controller, Request $request, ?int $requestType)
    {
        parent::__construct($kernel, $request, $requestType);

        $this->setController($controller);
    }

    /**
     * Returns the current controller.
     *
     * @return callable
     */
    public function getController()
    {
        return $this->controller;
    }

    public function setController(?callable $controller)
    {
        $this->controller = $controller;
    }
}